using System;
using System.Runtime.InteropServices;

namespace Fireball.ArchLinux.Pacman
{
	public class constants
	{
		public const int PKG_FILENAME_LEN	=	512;
		public const int PKG_NAME_LEN		=	256;
		public const int PKG_VERSION_LEN		=	64;
		public const int PKG_FULLNAME_LEN	=	(PKG_NAME_LEN + PKG_VERSION_LEN);
		public const int PKG_DESC_LEN		=	512;
		public const int PKG_URL_LEN			=	256;
		public const int PKG_DATE_LEN		=	32;
		public const int PKG_TYPE_LEN		=	32;
		public const int PKG_PACKAGER_LEN	=	64;
		public const int PKG_MD5SUM_LEN		=	33;
		public const int PKG_SHA1SUM_LEN		=	41;
		public const int PKG_ARCH_LEN		=	32;	
	}
	
	[StructLayoutAttribute(LayoutKind.Sequential)]
	public class pmpkg {
				
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=constants.PKG_FILENAME_LEN)]
		public string filename;
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=constants.PKG_NAME_LEN)]		
		public string name;
		
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=constants.PKG_VERSION_LEN)]	
		public string version;
		
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=constants.PKG_DESC_LEN)]
		public string desc;
		
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=constants.PKG_URL_LEN)]
		public string url;
		
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=constants.PKG_DATE_LEN)]
		public string builddate;
		
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=constants.PKG_TYPE_LEN)]
		public string buildtype;
		
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=constants.PKG_DATE_LEN)]
		public string installdate;
		
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=constants.PKG_PACKAGER_LEN)]
		public string packager;
		
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=constants.PKG_MD5SUM_LEN)]
		public string md5sum;
		
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=constants.PKG_SHA1SUM_LEN)]
		public string sha1sum;
		
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=constants.PKG_ARCH_LEN)]
		public string arch;
		
		public long size;
		public long isize;
		public short scriptlet;
		public short force;
		public IntPtr date;
		public IntPtr reason;
		/* alpm_list_t *desc_localized;*/
		public IntPtr licenses;
		public IntPtr replaces;
		public IntPtr groups;
		public IntPtr files;
		public IntPtr backup;
		public IntPtr depends;
		public IntPtr removes;
		public IntPtr requiredby;
		public IntPtr conflicts;
		public IntPtr provides;
	}
}
